package br.com.main.client.system.morador;

import br.com.main.client.system.morador.MeusDadosPresenterM.Display;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class MeusDadosViewM extends Composite implements Display{

	private HorizontalPanel panel;
	private TextBox tbNome;
	private TextBox tbCpf;
	private TextBox tbLogin;
	private TextBox tbEmail;
	private TextBox tbTelefone;
	private TextBox tbData_nasc;

	private Button btEditar;
	private Button btCancel;
	private Button btSalvar;

	public MeusDadosViewM() {
		init();
		initWidget(panel);
	}

	private void init() {
		panel = new HorizontalPanel();
		panel.setSpacing(20);
		panel.addStyleName("bordaDados");
		
		tbNome = new TextBox();
		tbCpf = new TextBox();
		tbCpf.setEnabled(false);
		tbLogin = new TextBox();
		tbEmail = new TextBox();
		tbTelefone = new TextBox();
		tbData_nasc = new TextBox();

		VerticalPanel painelMorador = new VerticalPanel();
		painelMorador.setBorderWidth(1);

		painelMorador.add(new Label("Informações"));
		painelMorador.add(new Label("Nome"));
		painelMorador.add(tbNome);
		painelMorador.add(new Label("CPF"));
		painelMorador.add(tbCpf);
		painelMorador.add(new Label("Login"));
		painelMorador.add(tbLogin);
		painelMorador.add(new Label("Email"));
		painelMorador.add(tbEmail);
		painelMorador.add(new Label("Telefone"));
		painelMorador.add(tbTelefone);
		painelMorador.add(new Label("Data Nascimento"));
		painelMorador.add(tbData_nasc);

		HorizontalPanel panelBt = new HorizontalPanel();
		
		btEditar = new Button("Editar");
		btCancel = new Button("Cancelar");
		btSalvar = new Button("Salvar");
		btSalvar.setVisible(false);
		btCancel.setVisible(false);
		panelBt.add(btEditar);
		panelBt.add(btSalvar);
		panelBt.add(btCancel);
		panelBt.setSpacing(15);
		
		painelMorador.add(panelBt);
		
		panel.add(painelMorador);
		
		DecoratorPanel todo = new DecoratorPanel();
		todo.add(panel);
	}
	@Override
	public Button getBtCancel() {
		return btCancel;
	}

	@Override
	public Button getBtEditar() {
		return btEditar;
	}
	@Override
	public Button getBtSalvar() {
		return btSalvar;
	}

	@Override
	public TextBox getTbNome() {
		return tbNome;
	}
	@Override
	public TextBox getTbCpf() {
		return tbCpf;
	}
	@Override
	public TextBox getTbLogin() {
		return tbLogin;
	}
	@Override
	public TextBox getTbEmail() {
		return tbEmail;
	}
	@Override
	public TextBox getTbTelefone() {
		return tbTelefone;
	}
	@Override
	public TextBox getTbData_nasc() {
		return tbData_nasc;
	}
}